package com.example.tbag.healthcare.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.example.tbag.healthcare.R;
import com.example.tbag.healthcare.Util.CallPhoneUtil;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by tbag on 2017/4/21.
 */

public class CardActivity extends AppCompatActivity {

    @OnClick(R.id.text1)
    public void jump1() {
        Intent intent = new Intent(this, MainActivity.class);
        intent.putExtra("id", 0);
        startActivity(intent);
    }

    @OnClick(R.id.text2)
    public void jump2() {
        Intent intent = new Intent(this, MainActivity.class);
        intent.putExtra("id", 1);
        startActivity(intent);
    }

    @OnClick(R.id.text3)
    public void jump3() {
        Intent intent = new Intent(this, MainActivity.class);
        intent.putExtra("id", 2);
        startActivity(intent);
    }

    @OnClick(R.id.text4)
    public void jump4() {
        Intent intent = new Intent(this, MainActivity.class);
        intent.putExtra("id", 3);
        startActivity(intent);
    }
    
    

    @OnClick(R.id.right_btn)
    public void callForHelp() {
        CallPhoneUtil.call(this);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_card);
        ButterKnife.bind(this);
        startActivityForResult(new Intent(this,LoginActivity.class),0);
    }

    /*@Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        if(SharePerferenceUtil.getInstance().getString("type","").isEmpty()){
            startActivityForResult(new Intent(this,LoginActivity.class),0);
        }
    }*/

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(resultCode==1){
            finish();
        }
    }
}
